﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ReprojectWebMercator
{
    public partial class CesiumGLSL: GLSLFuncBase
    {
        public float czm_epsilon6 = 1e-6f;
        public float czm_epsilon7 = 1e-7f;
        public float czm_epsilon1 = 1e-1f;


        public bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon)
        {
            return all(lessThanEqual(abs(left - right), vec4(epsilon)));
        }

        public bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon)
        {
            return all(lessThanEqual(abs(left - right), vec3(epsilon)));
        }

        public bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon)
        {
            return all(lessThanEqual(abs(left - right), vec2(epsilon)));
        }

        public bool czm_equalsEpsilon(float left, float right, float epsilon)
        {
            return (abs(left - right) <= epsilon);
        }

    }
}
